#ifndef XLSXOPERATE_H
#define XLSXOPERATE_H

#include <QObject>
#include <QtXlsx>
#include <QJsonObject>
#include <QVector>



class XlsxOperate : public QObject
{
    Q_OBJECT
public:
    explicit XlsxOperate(QObject *parent = nullptr);
    ~XlsxOperate();

    Q_INVOKABLE void loadExcel(int fileFlag);
    Q_INVOKABLE bool createJsonProfile();

signals:

private:
    void createModbusCli_tcp();

    void createModbusCli_tcp_a();
    void createModbusCli_tcp_ab();
    void createModbusCli_tcp_abc();
    void createModbusCli_tcp_abcd();

    void createModbusCli_rtu();
    void createModbusCli_rtu_Multi();

    int selectRegisterType(int type);


private:
    QXlsx::Document* xlsx;

    // 通讯方式
    int m_dataFlag;

    // 客户端数量：如果是Modbus TCP，创建多个客户端；如果是Modbus RTU，JSON配置文件中创建多个寄存器列表
    int m_cliNum;
};

#endif // XLSXOPERATE_H
